package lic

import (
	"cgs-server/helper"
	"cgs-server/server"
	"net/http"
)

func init() {
	//server.Handle(http.MethodPost, "/api/Login/Login", Login, server.None)
	server.Post("/api/lic/Add", AddLicense, "添加License", server.None)
	server.Get("/api/lic/List", ListLicense, "查询License", server.None)
	server.Post("/api/lic/Enable", EnableLicense, "启用License", server.None)
	server.Get("/api/lic/Get", GetCurLic, "获取当前License配置信息", server.None)
}
func AddLicense(w http.ResponseWriter, r *http.Request) {

	helper.WriteJSON(w, server.OK("success"))
}

func ListLicense(w http.ResponseWriter, r *http.Request) {

	_, _ = helper.WriteJSON(w, server.OK("Get successfully!").WithData(""))
}

func EnableLicense(w http.ResponseWriter, r *http.Request) {

	_, _ = helper.WriteJSON(w, server.OK("Enable license successfully!"))
}

func GetCurLic(w http.ResponseWriter, r *http.Request) {
	_, _ = helper.WriteJSON(w, server.OK("Get successfully!").WithData(""))
}
